package com.study.bean;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.type.AnnotationMetadata;

/**
 * @desc:
 * @author: panxiyi
 * @date: 2023/5/20 3:27 下午
 */
public class MyImportSelector implements ImportSelector {
    @Override
    public String[] selectImports(AnnotationMetadata annotationMetadata) {

        try {
            Class<?> clazz = Class.forName("com.study.bean.Wolf");
            if (clazz != null) {
                return new String[]{"com.study.bean.Cat"};
            }
        } catch (ClassNotFoundException e) {
            //e.printStackTrace();

            return new String[0];
        }

        return null;
    }
}
